<template>
	<view>
		<view class="bg-zs p20 page_top" style="position: sticky;z-index: 1;">
			<view class="ov-h radius20">
				<u-tabs :list="tabs" :isScroll="false" :barStyle={background:$zs} :current="current"
					@change="e=>current=e" activeColor="#232323" />
			</view>
		</view>
		<view class="p20 pt0">
			<orderInfo :list="list"  />
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tabs: [{
						name: '待雇佣',
						status:'wait'
					},
					{
						name: '已雇佣他人',
						status:'other'
					},
					{
						name: '我已被雇佣',
						status:'hire'
					},
					{
						name: '订单已关闭',
						status:'close'
					},
				],
				current: 0,
				list: []
			};
		},
		watch: {
			current(e) {
				this.getList()
			},
		},
		onLoad() {
			this.getList()
		},
		onReachBottom() {
			this.getList('down')
		},
		methods: {
			getList(e) {
				e == 'down' ? this.page++ : this.page = 1
				let params = {
					page: this.page,
					status: this.tabs?.[this.current]?.status || ''
				}
				this.$request('/master/index/offerList', params).then(res => {
					let list = res.data.data
					e == 'down' ? this.data.push(...list) : this.list = list
				})
			},
		}
	}
</script>

<style lang="scss">
	.page_top {
		top: 0rpx;
		/* #ifdef H5 */
		top: 44px;
		/* #endif */
	}
</style>
